-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't let find search filesystem mounts in docker build run step #10131
Don't let find search filesystem mounts in docker build run step #10131
Conversation
|
Welcome @tomodachi! |
Hi @tomodachi. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Dockerfile
Outdated
@@ -38,4 +38,4 @@ RUN apt update -q \ | |||
&& echo $(curl -L https://dl.k8s.io/release/$KUBE_VERSION/bin/linux/$(dpkg --print-architecture)/kubectl.sha256) /usr/local/bin/kubectl | sha256sum --check \ | |||
&& chmod a+x /usr/local/bin/kubectl \ | |||
&& rm -rf /var/lib/apt/lists/* /var/log/* \ | |||
&& find / -type d -name '*__pycache__' -prune -exec rm -rf {} \; | |||
&& find / -mount -type d -name '*__pycache__' -prune -exec rm -rf {} \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be sufficient to only look into the workdir and prevent the issue your are having IMO
&& find / -mount -type d -name '*__pycache__' -prune -exec rm -rf {} \; | |
&& find . -type d -name '*__pycache__' -prune -exec rm -rf {} \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah wait no that's for pip dep and they are installed system wide... But actually there is already the no compile flag to pip so I guess we could simply remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true that they shouldn't be created when pip is run with the no-compile flag
But examining this in a live docker container I realized that pycache files are created anyway.
They are created when the python3 python3-pip packages are installed.
So the find -prune is still useful as it will free up 17mb.
I've updated my PR to only search the /usr folder which is where the pycache files are located
Instead of searching the whole filesystem and ignoring mount points
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional insight! Could you squash your commits? Apart from that lgtm.
/ok-to-test |
ecfa13e
to
6e73554
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomodachi Thank you 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: floryut, tomodachi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
HI @tomodachi Would you please re-push the PR to trigger the CI again :-) |
8b81b7d
to
3ce4424
Compare
Limit find cmd to /usr/ where __pycache__ files are located
3ce4424
to
be9f442
Compare
/lgtm |
…10131) Limit find cmd to /usr/ where __pycache__ files are located
…10131) Limit find cmd to /usr/ where __pycache__ files are located
Limit find cmd to /usr/ where __pycache__ files are located Co-authored-by: Mateusz Mojsiejuk <[email protected]>
…10131) Limit find cmd to /usr/ where __pycache__ files are located
…10131) Limit find cmd to /usr/ where __pycache__ files are located
…10131) Limit find cmd to /usr/ where __pycache__ files are located
What type of PR is this?
kind bug
What this PR does / why we need it:
Fixes bug causing failure to build the ansible docker image with podman
Which issue(s) this PR fixes:
#10130
Fixes #10130
Special notes for your reviewer:
Does this PR introduce a user-facing change?: